/* 后台整体样式 */
.admin-body {
    margin: 0;
    padding: 0;
    background-color: #F5F7FA;
    font-family: 'Inter', sans-serif;
    color: #1D2129;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部导航栏（完整显示） */
.admin-header {
    background-color: #1D2129; /* 深色背景，突出管理系统特性 */
    color: white;
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 后台LOGO */
.admin-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.1rem;
}

.logo-icon {
    font-size: 1.5rem;
}

/* 用户信息区 */
.admin-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.username {
    color: #E5E9F2;
    font-size: 0.95rem;
}

.logout-btn {
    color: #E5E9F2;
    border-color: #4E5969;
    font-size: 0.9rem;
    padding: 5px 12px;
}

.logout-btn:hover {
    background-color: #4E5969;
    color: white;
}

/* 主容器（包含左侧导航和右侧内容） */
.admin-container {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 60px); /* 减去顶部导航高度 */
}

/* 左侧导航栏 */
.admin-sidebar {
    width: 220px;
    background-color: #282C34; /* 深灰背景，技术感 */
    color: white;
    padding-top: 20px;
    flex-shrink: 0; /* 不收缩，保持固定宽度 */
}

.admin-nav .nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin-bottom: 5px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: #E0E0E0;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.nav-link:hover {
    background-color: #383D48;
    color: white;
}

.nav-item.active .nav-link {
    background-color: #165DFF; /* 主色高亮当前页 */
    color: white;
}

.nav-icon {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* 右侧主内容区 */
.admin-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto; /* 内容过多时滚动 */
}

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

/* 统计卡片样式 */
.stat-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap; /* 小屏自动换行 */
}

.stat-col {
    flex: 1;
    min-width: 200px; /* 最小宽度，避免挤压 */
}

.stat-card {
    text-align: center;
    padding: 20px 15px;
}

.stat-title {
    color: #4E5969;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 600;
    color: #165DFF;
    margin-bottom: 5px;
}

.stat-desc {
    color: #4E5969;
    font-size: 0.85rem;
}

/* 操作区样式 */
.operation-card {
    margin-top: 20px;
}

.operation-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.op-col {
    flex: 1;
    min-width: 150px;
}

.op-btn {
    width: 100%;
    padding: 10px 0;
}

/* 适配移动终端（流式布局） */
@media (max-width: 768px) {
    .admin-sidebar {
        width: 70px; /* 小屏收缩侧边栏 */
    }
    
    .nav-text {
        display: none; /* 小屏隐藏文字，只留图标 */
    }
    
    .nav-link {
        justify-content: center; /* 图标居中 */
        padding: 12px 0;
    }
}


/* 文章管理专用样式 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

/* 筛选表单样式 */
.filter-card {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.form-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #E5E9F2;
    border-radius: 6px;
    font-size: 0.95rem;
}

.form-textarea {
    min-height: 150px;
    resize: vertical;
}

.form-action {
    display: flex;
    align-items: flex-end;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.form-hint {
    margin-top: 5px;
    font-size: 0.8rem;
    color: #4E5969;
}

/* 表格样式扩展 */
.table-card {
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #E5E9F2;
}

.data-table th {
    background-color: #282C34;
    color: white;
    font-weight: 600;
}

.data-table .article-title {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-center {
    text-align: center !important;
}

/* 状态标签 */
.status-tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-published {
    background-color: rgba(52, 199, 89, 0.1);
    color: #34C759;
}

.status-draft {
    background-color: rgba(156, 163, 175, 0.1);
    color: #9CA3AF;
}

/* 操作按钮 */
.operation-btns {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.85rem;
}

.btn-danger {
    background-color: #FF3B30;
    color: white;
}

.btn-danger:hover {
    background-color: #D32F2F;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.page-btn, .page-num {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid #E5E9F2;
    border-radius: 4px;
    text-decoration: none;
    color: #1D2129;
    background-color: white;
    font-size: 0.9rem;
}

.page-num.active {
    background-color: #165DFF;
    color: white;
    border-color: #165DFF;
}

.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* 表单卡片 */
.form-card {
    padding: 20px;
}

.required {
    color: #FF3B30;
}

.success-hint {
    padding: 10px 15px;
    background-color: rgba(52, 199, 89, 0.1);
    border-left: 4px solid #34C759;
    color: #2E7D32;
    border-radius: 4px;
    margin-bottom: 15px;
}

/* 富文本编辑器适配 */
.note-editor {
    border: 1px solid #E5E9F2 !important;
    border-radius: 6px !important;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .data-table th:nth-child(4), /* 阅读量 */
    .data-table td:nth-child(4) {
        display: none;
    }
    
    .operation-btns {
        flex-direction: column;
    }
    
    .page-num {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
}


/* 序号排序专用样式 */
.sort-input {
    width: 60px;
    padding: 5px;
}

.sort-form .form-actions {
    display: flex;
    justify-content: flex-end; /* 保存按钮靠右 */
}

/* 版本管理通用样式 */
.info-card {
    background-color: rgba(22, 93, 255, 0.05);
    border-left: 4px solid var(--primary);
    padding: 15px;
    margin-bottom: 20px;
}

.info-content p {
    margin: 5px 0;
    color: var(--text-secondary);
}

.version-code {
    font-family: 'Roboto Mono', monospace; /* 版本号使用等宽字体 */
    font-weight: 500;
}